package dachang.class1;

/**
 * @Author: Dijah
 * @Date: 2023/5/24 14:41
 * @Desc:
 */
public class code3_Near2Power {

    public static final int tableSizeFor(int n){
        n--;
        n |= n >>>1;
        n |= n >>>2;
        n |= n >>>4;
        n |= n >>>8;
        n |= n >>>16;
        return (n < 0) ? 1 : n + 1;
    }

    public static void main(String[] args) {
        int n = 9;
        System.out.println(tableSizeFor(n));
    }
}
